<%--
  Created by IntelliJ IDEA.
  User: 96216
  Date: 2017/8/11
  Time: 19:34
  To change this template use File | Settings | File Templates.
--%>
<%--
  Created by IntelliJ IDEA.
  User: 96216
  Date: 2017/8/8
  Time: 15:04
  To change this template use File | Settings | File Templates.
--%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学生管理</title>

</head>
<body>
<!--banner-->
<jsp:include page="/manager/common/head.jsp"></jsp:include>
<!--内容-->
<div class="container">
    <ol class="breadcrumb">
        <li><a href="${pageContext.request.contextPath}/m/main">首页</a>
        </li>
        <li class="active">教师管理</li>
    </ol>
    <div class="row">
        <div class="col-md-4"></div>

        <div class="col-md-5">
            <form class="navbar-form navbar-left" role="search" action="${pageContext.request.contextPath}/m/getTeacher">
                <div class="form-group">
                    <input type="text" name="name" class="form-control" placeholder="eg:李长贵">
                </div>
                <button type="submit" class="btn btn-success">搜索</button>
            </form>
        </div>
        <div class="col-md-3">
            <a href="${pageContext.request.contextPath}/m/addTea" class="btn btn-primary" role="button">添加学生</a>

        </div>
    </div>
    <div class="row">
        <div class="col-md-10 col-md-offset-1">
            <table class="table table-bordered table-hover table-responsive">
                <tr>
                    <th>工号</th>
                    <th>姓名</th>
                    <th>性别</th>
                    <th>职务</th>
                    <th>教研室</th>
                    <th>操作</th>

                </tr>
                <c:forEach items="${page.list}" var="teacher">
                    <tr>
                        <td>${teacher.teacherId}</td>
                        <td>${teacher.name}</td>
                        <td>${teacher.gender}</td>
                        <td>${teacher.position}</td>
                        <td>${teacher.office}</td>
                        <td>
                            <a class="btn btn-primary " href="${pageContext.request.contextPath}/m/updateTea?teacherId=${teacher.teacherId}">
                                      <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>修改</a>
                            <a  class="btn btn-danger" href="${pageContext.request.contextPath}/m/delTea?teacherId=${teacher.teacherId}">
                                <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除</a>

                        </td>
                    </tr>
                </c:forEach>

            </table>
        </div>
        <div class="row">
            <div class="col-md-6">
                当前第${page.pageNum}页,共有${page.pages}页,共有条${page.total}记录
            </div>
            <div class="col-md-6">
                <nav aria-label="Page navigation">
                    <ul class="pagination">
                        <li><a href="${pageContext.request.contextPath}/m/getTeacher?pn=${page.firstPage}">首页</a></li>
                        <c:if test="${page.hasPreviousPage}">
                            <li>
                                <a href="${pageContext.request.contextPath}/m/getTeacher?pn=${page.pageNum-1}" aria-label="Previous">
                                    <span aria-hidden="true">&laquo;</span>
                                </a>
                            </li>
                        </c:if>
                        <c:forEach items="${page.navigatepageNums}" var="page_Num">
                            <c:if test="${page_Num==page.pageNum}">
                                <li class="active"><a href="${pageContext.request.contextPath}/m/getTeacher?pn=${page_Num} ">${page_Num}</a></li>
                            </c:if>
                            <c:if test="${page_Num!=page.pageNum}">
                                <li><a href="${pageContext.request.contextPath}/m/getTeacher?pn=${page_Num}">${page_Num}</a></li>
                            </c:if>
                        </c:forEach>
                        <c:if test="${page.hasNextPage}">
                            <li>
                                <a href="${pageContext.request.contextPath}/m/getTeacher?pn=${page.pageNum+1}" aria-label="Next">
                                    <span aria-hidden="true">&raquo;</span>
                                </a>
                            </li>
                        </c:if>
                        <li><a href="${pageContext.request.contextPath}/m/getTeacher?pn=${page.lastPage}">尾页</a></li>
                    </ul>
                </nav>
            </div>

        </div>
    </div>

</div>

</body>
</html>
